package com.config;

import com.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@Configuration
@ComponentScan(basePackages = "com")
public class MySpringConfiguration {


    @Bean(value="p1",initMethod = "initPerson",destroyMethod = "destroyPerson")
    @Scope("singleton")
    public Person initPerson1(){
        return new Person("郭靖","男","2001-10-20","浙江桃花岛");
    }
}
